#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>


struct TreeNode {
	int val;
	struct TreeNode* left;
	struct TreeNode* right;
};


void BinaryTreePrevOreder(struct TreeNode* root, int* ret, int* pi)
{
    if (root == NULL)
        return;
    ret[(*pi)++] = root->val;
    BinaryTreePrevOreder(root->left, ret, pi);
    BinaryTreePrevOreder(root->right, ret, pi);
}

int* preorderTraversal(struct TreeNode* root, int* returnSize) {

    int* ret = (int*)malloc(sizeof(int) * 100);
    *returnSize = 0;
    BinaryTreePrevOreder(root, ret, returnSize);
    return ret;
}

int main()
{
    
    preorderTraversal()
    return 0;
}